package com.bugpool.leilema.tc.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bugpool.leilema.tc.bean.entity.TreeEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author wh
 * @Description
 * @Date 2023/2/28 9:23
 * @Version 1.0
 **/
@Mapper
public interface TreeMapper extends MyBaseMapper<TreeEntity> {

    /**
     * 根据用户 id 获取 dataTree 集合
     * @param userId
     * @return
     */
    List<TreeEntity> selectByUserId(@Param("userId") Long userId);


    /**
     * 删除 跟用户关联的数据图层
     * @param userId
     */
    void delByUserId(Long userId);


    /**
     * 重新关联用户和数据图层的关系
     * @param userId
     * @param treeIds
     */
    void insertTreeByUserId(@Param("userId") Long userId,@Param("treeIds") List<Long> treeIds);


    void insertTest();
}
